package ncme.auto.framework.core.configs;

import ncme.auto.framework.core.resolvers.AutoArgumentResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import java.util.List;

@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        // 添加AutoRequestBody参数解析器
        argumentResolvers.add(new AutoArgumentResolver());
    }

//    @Override
//    public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) {
//        super.addReturnValueHandlers(returnValueHandlers);
//        //添加返回结果处理器
//        returnValueHandlers.add(new AutoResultHandler());
//    }

}
